
#pragma once

class TcpPortTestPassiveConnectionActorMgr : public ActorMgrBase
{
public:
    TcpPortTestPassiveConnectionActorMgr(std::size_t _workerPoolSize = 1);
    virtual ~TcpPortTestPassiveConnectionActorMgr();

    virtual retT makeActor(boost::shared_ptr<ActorBase>& _pActor);
};

class TcpPortTestPassiveConnectionActor : public ActorBase, public virtual IAcceptableActor, public virtual ITcpAction
{
public:
    TcpPortTestPassiveConnectionActor();
    virtual ~TcpPortTestPassiveConnectionActor();

    virtual retT start();
	virtual retT init();

    virtual retT onRead( boost::shared_ptr<DataHandlerContext> _pDataHandlerContext, std::size_t _bytesTransferred, const boost::system::error_code& e, std::size_t _timeoutCount);
    virtual retT onWrite( boost::shared_ptr<DataHandlerContext> _pDataHandlerContext, std::size_t _bytesTransferred, const boost::system::error_code& e, std::size_t _timeoutCount);

	virtual boost::shared_ptr<boost::asio::ip::tcp::socket> getTcpSocket();

protected:
	boost::shared_ptr<TcpHandler> pTcpConnectionHandler;
};
